<template>
    <view>
        <web-view :src="url"></web-view>
    </view>
</template>
<script setup>
import { ref } from 'vue';
import { onReady } from '@dcloudio/uni-app';
import { getCurrentVar } from '@/commons/utils';

const props = defineProps({
    type: String
});

let url = ref('');
let title = '';

onReady(() => {
    const type = props.type;
    if (type === 'service') {
        title = '用户协议';
    } else if (type === 'privacy') {
        title = '隐私声明';
    }
    uni.setNavigationBarTitle({ title });
    url.value = getCurrentVar('SHOP_H5_BASE_HOST') + '/agreement/' + type + '.html';
});
</script>
<style lang="scss" scoped></style>
